package cc.customer.diaRecord.services.Impl;


import cc.customer.common.domain.ResponseBo;
import cc.customer.common.service.impl.BaseService;
import cc.customer.common.utils.DateUtil;
import cc.customer.common.utils.Utils;
import cc.customer.diaRecord.dao.CDydiaRecordMapper;
import cc.customer.diaRecord.domain.CDydiaRecord;
import cc.customer.diaRecord.services.CdyDiaRecordServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class CdyDiaRecordServicesImpl extends BaseService<CDydiaRecord> implements CdyDiaRecordServices {

    @Autowired
    private CDydiaRecordMapper cDydiaRecordMapper;

    @Override
    public ResponseBo addCdyDiaRecord(CDydiaRecord cDydiaRecord) {
        try {
            cDydiaRecord.setsDiaTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
            cDydiaRecord.setsDiaUuid(Utils.getUUID());
             cDydiaRecordMapper.insert(cDydiaRecord);
        }catch (Exception e){
            e.printStackTrace();
        }
        return ResponseBo.error();
    }
}
